﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.ComponentModel.DataAnnotations;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using LayuiDemo.Models;


namespace LayuiDemo.ViewModels.PostVMs
{
    public partial class PostVM : BaseCRUDVM<Post>
    {
        public List<ComboSelectListItem> AllBlogs { get; set; }
        public BlogVMs.BlogListVM BlogList { get; set; } = new BlogVMs.BlogListVM();
		public PostVM()
        {
            SetInclude(x => x.Blog);
        }

        protected override void InitVM()
        {
            AllBlogs = DC.Set<Blog>().GetSelectListItems(Wtm, y => y.Url);
        }

        public override void DoAdd()
        {           
            base.DoAdd();
        }

        public override void DoEdit(bool updateAllFields = false)
        {
            base.DoEdit(updateAllFields);
        }

        public override void DoDelete()
        {
            base.DoDelete();
        }
    }
}
